package cn.csc.module.distribute.convert.downline;

import cn.csc.framework.common.pojo.PageResult;
import cn.csc.module.distribute.api.downline.dto.CreateDistributeDownlineReqDTO;
import cn.csc.module.distribute.api.downline.dto.DistributeDownlineDTO;
import cn.csc.module.distribute.controller.admin.downline.vo.DistributeDownlineCreateReqVO;
import cn.csc.module.distribute.controller.admin.downline.vo.DistributeDownlineExcelVO;
import cn.csc.module.distribute.controller.admin.downline.vo.DistributeDownlineRespVO;
import cn.csc.module.distribute.controller.admin.downline.vo.DistributeDownlineUpdateReqVO;
import cn.csc.module.distribute.dal.dataobject.downline.DistributeDownlineDO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import java.util.List;

/**
 * 分销下线信息 Convert
 *
 * @author liuchuang
 */
@Mapper
public interface DistributeDownlineConvert {

    DistributeDownlineConvert INSTANCE = Mappers.getMapper(DistributeDownlineConvert.class);

    DistributeDownlineDO convert(DistributeDownlineCreateReqVO bean);

    DistributeDownlineDO convert(DistributeDownlineUpdateReqVO bean);

    DistributeDownlineRespVO convert(DistributeDownlineDO bean);

    @Mapping(target = "childId", source = "userId")
    DistributeDownlineDO convert1(CreateDistributeDownlineReqDTO reqDTO);

    List<DistributeDownlineRespVO> convertList(List<DistributeDownlineDO> list);

    PageResult<DistributeDownlineRespVO> convertPage(PageResult<DistributeDownlineDO> page);

    List<DistributeDownlineExcelVO> convertList02(List<DistributeDownlineDO> list);

    DistributeDownlineDTO convert01(DistributeDownlineDO bean);

}
